import request from '/@/utils/request';

/**
 * 任务操作接口
 * @method 
 * @method 
 */
export function useJobApi() {
	return {
		// getPosList: (params?: object) => {
		// 	return request<any, AjaxResult>({
		// 		url: '/pos/List',
		// 		method: 'get',
		// 		params,
		// 	});
		// },
		jobPageList: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PageJobDetailList',
				method: 'post',
				data,
			});
		},
		addJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/AddJobDetail',
				method: 'post',
				data,
			});
		},
		editJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/UpdateJobDetail',
				method: 'post',
				data,
			});
		},
		deleteJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/DeleteJobDetail',
				method: 'post',
				data,
			});
		},
		jobTriggerList: (params?: object) => {
			return request<any, AjaxResult>({
				url: '/job/JobTriggerList',
				method: 'get',
				params,
			});
		},
		addTrigger: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/AddJobTrigger',
				method: 'post',
				data,
			});
		},
		editTrigger: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/UpdateJobTrigger',
				method: 'post',
				data,
			});
		},
		deleteTrigger: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/DeleteJobTrigger',
				method: 'post',
				data,
			});
		},
		pauseAllJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PauseAllJob',
				method: 'post',
				data,
			});
		},
		startAllJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/StartAllJob',
				method: 'post',
				data,
			});
		},
		pauseJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PauseJob',
				method: 'post',
				data,
			});
		},
		startJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/StartJob',
				method: 'post',
				data,
			});
		},
		cancelJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/CancelJob',
				method: 'post',
				data,
			});
		},
		runJob: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/RunJob',
				method: 'post',
				data,
			});
		},
		pauseTrigger: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PauseTrigger',
				method: 'post',
				data,
			});
		},
		startTrigger: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/StartTrigger',
				method: 'post',
				data,
			});
		},
		cancelSleep: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/CancelSleep',
				method: 'post',
				data,
			});
		},
		persistAll: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PersistAll',
				method: 'post',
				data,
			});
		},
		getJobClusterList: (params?:object) => {
			return request<any, AjaxResult>({
				url: '/job/JobClusterList',
				method: 'get',
				params,
			});
		},
		pageJobTriggerRecord: (data={}) => {
			return request<any, AjaxResult>({
				url: '/job/PageJobTriggerRecord',
				method: 'post',
				data,
			});
		},
	};
}
